package com.motorwaymanage.actions;

import java.util.List;
import java.util.Map;

import com.motorwaymanage.beans.JsonObject;
import com.motorwaymanage.beans.LocationInfo;
import com.motorwaymanage.beans.SheBeiInfo;
import com.motorwaymanage.biz.ILocationInfoBiz;
import com.motorwaymanage.biz.ISheBeiInfoBiz;
import com.motorwaymanage.impl.LocationInfoBizImpl;
import com.motorwaymanage.impl.SheBeiInfoBizImpl;
import com.opensymphony.xwork2.ActionSupport;
import com.sun.net.httpserver.Authenticator.Success;

public class SheBeiInfoAction extends ActionSupport {
	private static final long serialVersionUID = 1L;
	private ISheBeiInfoBiz sheBeiInfoBiz = new SheBeiInfoBizImpl();
	private SheBeiInfo sbi;
	private JsonObject json;
	
	public JsonObject getJson() {
		return json;
	}
	
	public SheBeiInfo getSbi() {
		return sbi;
	}

	public void setSbi(SheBeiInfo sbi) {
		this.sbi = sbi;
	}

	public String getSheBeiList() {
		List result = sheBeiInfoBiz.getSheBeiList();
		if(result!=null){
			json=new JsonObject();
			json.setRows(result);
			return SUCCESS;
		}else{
			return null;
		}
	}
	
	public String addSheBeiInfo() {
		System.out.println(sbi);
		json=new JsonObject();
		json.setResult(sheBeiInfoBiz.addSheBeiInfo(sbi));
		return SUCCESS;
	}
}
